﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Automobile.service.Model;
using Automobile.service.BLL;
using Automobile.service.Common;
namespace Automobile.service.UI.Hander
{
    /// <summary>
    /// GetProductByID 的摘要说明
    /// </summary>
    public class GetProductByID : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
           
            context.Response.ContentType = "text/plain";
            ProductBLL bll = new ProductBLL();
            int id=Convert.ToInt32(context.Request["id"]);
            List<Product> p = bll.GetProductByID(id);
            context.Response.Write(new System.Web.Script.Serialization.JavaScriptSerializer { MaxJsonLength=Int32.MaxValue}.Serialize(p));
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}